package com.donleo.stmg.relation.controller;


import com.donleo.stmg.common.api.CommonResult;
import com.donleo.stmg.relation.model.UserTeamRelation;
import com.donleo.stmg.relation.service.UserTeamRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 用户小组关联表 前端控制器
 * </p>
 *
 * @author liangd
 * @since 2020-12-21
 */
@RestController
@RequestMapping("/userTeamRelation")
public class UserTeamRelationController {

    @Autowired
    private UserTeamRelationService userTeamRelationService;

    /**
     * 根据小组编号查询
     * @param teamCode
     * @return
     */
    @GetMapping("/findByTeamCode")
    public CommonResult findByTeamCode(String teamCode){
        List<UserTeamRelation> list = userTeamRelationService.findByTeamCode(teamCode);
        return CommonResult.success(list);
    }
}
